home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / Libraries / tcl7.4b3 / doc / split.n < prev    next >
Encoding:
Text File  |  1994-12-17  |  1.3 KB  |  45 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" Copyright (c) 1994 Sun Microsystems, Inc.
  4. '\"
  5. '\" See the file "license.terms" for information on usage and redistribution
  6. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  7. '\" 
  8. '\" @(#) split.n 1.2 94/12/17 16:18:50
  9. '\" 
  10. .so man.macros
  11. .HS split tcl
  12. .BS
  13. '\" Note:  do not modify the .SH NAME line immediately below!
  14. .SH NAME
  15. split \- Split a string into a proper Tcl list
  16. .SH SYNOPSIS
  17. \fBsplit \fIstring \fR?\fIsplitChars\fR?
  18. .BE
  19.  
  20. .SH DESCRIPTION
  21. .PP
  22. Returns a list created by splitting \fIstring\fR at each character
  23. that is in the \fIsplitChars\fR argument.
  24. Each element of the result list will consist of the
  25. characters from \fIstring\fR that lie between instances of the
  26. characters in \fIsplitChars\fR.
  27. Empty list elements will be generated if \fIstring\fR contains
  28. adjacent characters in \fIsplitChars\fR, or if the first or last
  29. character of \fIstring\fR is in \fIsplitChars\fR.
  30. If \fIsplitChars\fR is an empty string then each character of
  31. \fIstring\fR becomes a separate element of the result list.
  32. \fISplitChars\fR defaults to the standard white-space characters.
  33. For example,
  34. .DS
  35. \fBsplit "comp.unix.misc" .\fR
  36. .DE
  37. returns \fB"comp unix misc"\fR and
  38. .DS
  39. \fBsplit "Hello world" {}\fR
  40. .DE
  41. returns \fB"H e l l o { } w o r l d"\fR.
  42.  
  43. .SH KEYWORDS
  44. list, split, string
  45.